<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
   <link rel="stylesheet" href="/Sys/css/layui.css">
<link rel="stylesheet" href="/Sys/css/sign.css">

<link rel="stylesheet"
	href="/Sys/js/css/modules/layui-icon-extend/iconfont.css">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="/Sys/css/font.css">
<link rel="stylesheet" href="/Sys/css/xadmin.css">
<script type="text/javascript"
	src="/Sys/js/jquery-3.3.1.min.js"></script>
<script src="/Sys/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="./js/xadmin.js"></script>
<script type="text/javascript" src = "/Sys/js/jquery.table2excel.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">演示</a>
        <a>
          <cite>导航元素</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
      <xblock >
        <button type="button" class="layui-btn layui-btn-primary" id="uploadExcel">批量导入</button>
        <button type="button" class="layui-btn layui-btn-primary" onclick="exportTable()">批量导出</button>
      </xblock>
  <table id="test" lay-filter="test"></table>
 
  </body>
  <script >
  var documentWidth = $(document).width();
  layui.use(['table','form'],function(){
	  var table = layui.table;
      table.render({
          elem: '#test'  //绑定table表格
          ,id:'csInfo'
          ,method:'post'
          ,url: 'getScoreByStuName' //后台springmvc接收路径
          ,page: { //支持传入 laypage 组件的所有参数（某些参数除外，如：jump/elem） - 详见文档
  	        layout: ['limit', 'count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
	      //,curr: 5 //设定初始在第 5 页
	      ,groups: 1 //只显示 1 个连续页码
	      ,first: false //不显示首页
	      ,last: false //不显示尾页
	      ,limit:10
	      ,limits:[10,20,30]
	    }
          ,cols: [
        	  [
             {type: 'checkbox',width:documentWidth*4/100} 
              ,{field:'stuno',title:'学号', width:documentWidth*10/100, sort: true}
              ,{field:'name',title:'姓名', width:documentWidth*8/100,sort:true}
              ,{field:'coursename',title:'学科',width:documentWidth*8/100,sort:true}
              ,{field:'score',edit: 'text',title:'成绩',width:documentWidth*8/100,sort:true}
              ,{field:'type',edit: 'text',title:'类型',width:documentWidth*8/100,sort:true}
          ]
        	  ]
         
      });

 		  $('.layui-btn').on('click', function(){
 		    var type = $(this).data('type');
 		    active[type] ? active[type].call(this) : '';
 		  });	     		  
 		});
</script>  
  
</html>